#ifndef __WORLD_H
#define __WORLD_H

/*
	WORLD.H

  	The CWorld class

	Description: The CWorld class represents the game world
			   of the engine. All objects, the terrain,
			   audio system, ambient world music and sound,
			   and the camera are held here.


*/
#include <typeinfo.h>
#include "gui.h"
#include "player.h"
#include "sod.h"
#include "ogro.h"
#include "droid.h"
#include "entity.h"
#include "md2.h"
#include "object.h"
#include "camera.h"
#include "terrain.h"
#include "DirectXAudio.h"
#include "tree.h"
#include "hud.h"
#include <vector>

#define MAX_ENEMIES 10


class CWorld
{
private:
	int numOgros, numSods, numDroids;
	int screenWidth, screenHeight;
	bool gameDone;
	
	float worldCloseDistance, worldFarDistance;

protected:
	void OnAnimate(float deltaTime);
	void OnDraw(CCamera *camera);
	void OnPrepare();

public:
	HWND hwnd;

	CTerrain *terrain;
	CCamera *camera;			// the camera
	CPlayer *player;
	CDirectXAudio *audioSystem;
	CGUI *gui;
	COgroEnemy *ogroEnemy;
	CSodEnemy *sodEnemy;
	CDroidEnemy *droidEnemy;
	float timeStart;
	float timeElapsed;

	Hud *hud;

	CWorld();
	CWorld(CCamera *c);
	~CWorld();

	// initialize terrain, load objects and put in container
	void LoadWorld();
	void UnloadWorld();

	int CountObjectTypes(const type_info &classID);

	void Animate(float deltaTime);

	void Draw(CCamera *camera);
	void Prepare() { OnPrepare(); }

	void FadeScreen();
	void SetScreen(int width, int height);

	bool IsGameDone() { return gameDone; }
	void QuitGame() { gameDone = true; }
	int GetOgros() { return numOgros; }
	int GetSods() { return numSods; }
	int GetDroids() { return numDroids; }
	std::vector<CEnemy*> CWorld::GetEnemies();
	
	void setWorldDistance(float c, float f);
	float getCloseDistance();
	float getFarDistance();
	
};


#endif